﻿@model ICollection<MoviesRoom.ViewModels.Film.FilmViewModel>

@if (Model.Count > 0)
{
    foreach (var item in Model)
    {
            <div class="span5 film-section" value="@item.Id">
                <h2 class="main-page-title">@item.Title</h2>
                <a href="@(Url.Action("SingleFilm", "Home", new { item.Id }))">
                    <img src="@((item.Image != null) ? @item.Image : ".. /../img/Unavailable_Pic.gif")"
                         alt="@item.Title" class="film-image" />
                </a>
                <strong class="film-title-description">Description:</strong>
                @if (@item.Description != null)
                {
                                    <p class="film-description">@(item.Description.Length > 140 ? item.Description.Substring(0, 140) + "..." : item.Description)</p>
                }
                else
                {
                    <p class="film-description">No Description</p>
                }
                <div class="additional-info">
                    <div class="started-date">
                        Launch Date: <strong>@string.Format("{0:dd/MMM/yyyy HH:mm}", item.StartDate)</strong>
                    </div>
                    <div class="price">
                        Ticket Price: <strong>€@item.PricePerTicket</strong>
                    </div>
                    <div class="available-tickets">
                        Available Tickets: <strong>@item.AvailableTickets</strong>
                    </div>
                    <div class="available-tickets">
                        Category: <strong>@item.Category.Name</strong>
                    </div>
                </div>
                <div>
                    <a class="btn btn-primary buy-btn" href="~/Home/SingleFilm/@item.Id">Film Details &raquo;</a>
                    <div class="rating">
        
                        @if (item.VoteAsString != null)
                        {
                                                    <span> @item.VoteAsString </span>
                        }
                        else
                        {
                            <span>0.0</span>
                        }
                    </div>
                </div>
            </div>
    }
}
else
{
    <h3 id="no-found">Nothing was found</h3>
}